/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package grex.fitnessfunctions.ErrorFunctions;

import grex.Environment;
import grex.Prediction;
import grex.PredictionContainer;
import grex.fitnessfunctions.FitnessFunction;
import grex.fitnessfunctions.IFitnessFunction;
import grex.genes.Gene;
import grex.genes.HybridPred;
import grex.genes.If;

/**
 *
 * @author RIK
 */
public class ErrorInstances extends FitnessFunction{
    
    public ErrorInstances(){
        super("INST");
    }       
    public ErrorInstances(String name,Double instanceKey) {
        super(name,instanceKey);
    }
    @Override
    protected double calcPredictionError(Prediction prediction, double targetValue) {
        if(prediction.getL()instanceof HybridPred)
            return 1;
        return 0;
    }
    
    @Override        
    protected double normalizeTotalError(double totalError){
        return totalError/100;
    }

}
